<template>
  <div>
    <!-- 三级联动的组件 -->
    <TypeNav></TypeNav>
    <!-- 轮播 -->
    <ListContainer></ListContainer>
    <!-- 今日推荐 -->
    <Recommend></Recommend>
    <!-- 商品排行 -->
    <Rank></Rank>
    <!-- 喜欢 -->
    <Like></Like>
    <!-- 家用电器 -->
    <Fllor v-for="floor in floorList" :key="floor.id" :list="floor"></Fllor>
    <!-- 商标 -->
    <Brand></Brand>
  </div>
</template>

<script>
import ListContainer from "./ListContainer/index.vue";
import Recommend from "./Recommend/index.vue";
import Rank from "./Rank/index.vue";
import Like from "./Like/index.vue";
import Fllor from "./Fllor/index.vue";
import Brand from "./Brand/index.vue";
import { mapState } from "vuex";
export default {
  //注册局部组件
  components: {
    ListContainer,
    Recommend,
    Rank,
    Like,
    Fllor,
    Brand,
  },
  computed: {
    ...mapState({
      floorList: (state) => state.home.floorList,
    }),
  },
  mounted() {
    //获取floor的数据
    this.$store.dispatch("home/getFlootList");
    //获取用户信息
    this.$store.dispatch("user/getUserInfo");
  },
};
</script>

<style></style>
